home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / wla_020_3.0 / wla_020_2.3 / wla.txt < prev    next >
Text File  |  2000-02-28  |  25KB  |  926 lines

  1.  
  2. ------------------------------------------------------------------------------
  3.      WLA GB-Z80 Macro Assembler v2.3 Copyright 1998-2000 by Ville Helin
  4. ------------------------------------------------------------------------------
  5.  
  6.  
  7. 1..... Introduction
  8. 2..... WLA History
  9. 3..... WLALINK History
  10. 4..... Assembler Directives
  11. 5..... Assembler Syntax
  12.  5.1.. Case Sensitivity
  13.  5.2.. Comments
  14.  5.3.. Labels
  15.  5.4.. Number Types
  16.  5.5.. Strings
  17.  5.6.. Supported GB-Z80 Commands
  18. 6..... Error Messages
  19. 7..... Supported Types
  20.  7.1.. ROM Size
  21.  7.2.. RAM Size
  22.  7.3.. Cartridge Type
  23. 8..... Bugs
  24. 9..... Files
  25.  9.1.. 'features_test.s'
  26.  9.2.. 'gb_hardware.i'
  27.  9.3.. 'cgb_hardware.i'
  28.  9.4.. 'nintendo_logo.i'
  29.  9.5.. 'pocket_voice.i'
  30. 10.... Temporary Files
  31. 11.... Compiling
  32.  11.1. Compiling ROM Images
  33.  11.2. Compiling Object Files
  34.  11.3. Compiling Library Files
  35. 12.... Linking
  36. 13.... Pocket Voice
  37. 14.... Author
  38. 15.... Thanks
  39. 16.... Future
  40. 17.... Support
  41. 18.... Legal Note
  42.  
  43.  
  44.  
  45. ------------------------------------------------------------------------------
  46. 1... Introduction
  47. ------------------------------------------------------------------------------
  48.  
  49.  
  50. Here is yet another macro assembler to help you to produce Game Boy software.
  51.  
  52. I wrote this because I had never written an assembler before and I really
  53. needed a macro assembler which could read the GB-Z80 code I wrote. ;)
  54.  
  55. This is my ideal GB-Z80 macro assembler (not in final form, not yet). ;)
  56. Tastes differ. Thus WLA!
  57.  
  58. I will not release WLA's source code, not now, as it is ugly, and would
  59. put me into shame. ;) Any comments are gladly accepted. And if you produce
  60. nice software with WLA, send me mail about it (or even the whole programme)!
  61. ;)
  62.  
  63.  
  64.  
  65. ------------------------------------------------------------------------------
  66. 2... WLA History
  67. ------------------------------------------------------------------------------
  68.  
  69.  
  70. v2.3 (23-Jan-2000) Added .SECTION, .ENDS.
  71.                    Added "-l" -option for library file producing.
  72.                    Fixed address calculations a little more.
  73.                    WLA returns -1 when execution ended in error.
  74.                    Local labels are now local to sections or object file.
  75.                    Enhanced the documents.
  76.  
  77. v2.2 (16-Jan-2000) Added .DSW, .DW, .ENUM and .ENDE.
  78.  
  79. v2.1 (14-Jan-2000) Added $BE (Pocket Voice) to supported cartridge types.
  80.                    Added "-v" -option for verbose information displaying.
  81.                    Optimized pass 1.
  82.                    Fixed possible errors in address calculations.
  83.  
  84. v2.0 (12-Jan-2000) Enhanced the documents.
  85.                    Optimized internal pass 2 and directive including.
  86.                    Fixed overflow check (in .ORG).
  87.                    Added "-o" -option for object file producing.
  88.                    Added linker executable "wlalink".
  89.                    Added .INCDIR.
  90.  
  91. v1.9 (06-Jan-2000) Optimized .INCBIN, .INCLUDE and internal passes
  92.                     1 and 2.
  93.  
  94. v1.8 (23-Dec-1999) Enhanced the documents.
  95.                    Fixed overflow checker once again. Every bank gained one
  96.                     byte more (total 16384).
  97.  
  98. v1.7 (04-Dec-1999) Enhanced the documents.
  99.                    Added gb_hardware.i.
  100.                    .INCBIN didn't free buffer memory.
  101.                    Optimized .INCBIN.
  102.                    .INCBIN now caches all the files.
  103.                    Optimized internal passes 1 and 2.
  104.                    Linux version is optimized for 486.
  105.  
  106. v1.6 (14-Nov-1999) Enhanced the documents.
  107.                    Fixed nintendo_logo.i so it works on a real Game Boy.
  108.                    Fixed complement check calculation to work.
  109.                    Overflow checker thought GB ROM banks were 8KB each!
  110.                     Fixed to 16KB. Ville no baka!
  111.                    Added .REPT.
  112.                    Added .ENDR.
  113.  
  114. v1.5 (10-Jun-1999) Enhanced the documents.
  115.                    WLA does now one pass to the input data and
  116.                     two passes to the internal data.
  117.  
  118. v1.4 (25-May-1999) Renamed nintendo_logo.s to nintendo_logo.i.
  119.                    Fixed nintendo_logo.i Wzonka-Lad-compatible.
  120.                    Fixed pass-texts, as WLA does actually one pass,
  121.                     three of the old ones were made to the WLA's internal data.
  122.                    Added one funky new optcode, "DEBUG", which will
  123.                     translate to $ED (unused in GB-Z80). This one will
  124.                     flash the power light when executed on Wzonka-Lad,
  125.                     my Game Boy emulator. Use it only for debugging!
  126.  
  127. v1.3 (01-Jan-1999) Enhanced the documents.
  128.                    WLA now shows the unused areas of the ROM file after
  129.                     a successful compile in hexadecimal format.
  130.                    Many WLA directives accepted non-pure values, not anymore.
  131.                    Added .DSB.
  132.                    .DB handles now strings as well.
  133.  
  134. v1.2 (21-Dec-1998) Enhanced the documents.
  135.                    Added a list ("gb-z80.txt") of the supported GB-Z80 commands
  136.                     to the archive.
  137.                    Free strings don't break the compile loop anymore.
  138.                    Added .INCBIN.
  139.  
  140. v1.1 (13-Dec-1998) Enhanced the documents.
  141.                    Removed an unused function.
  142.                    Number input now detects and discards numbers from
  143.                     outside the word boundaries.
  144.                    WLA now shows the unused areas of the ROM file after
  145.                     a successful compile.
  146.                    Added .IFNDEF.
  147.                    Added .IFDEF.
  148.                    Added .ELSE.
  149.                    Added .ENDIF.
  150.                    Added @@@ to .MACRO.
  151.                    .DB accepted values from outside the byte boundaries.
  152.  
  153. v1.0 (12-Dec-1998) The first public release.
  154.  
  155.  
  156.  
  157. ------------------------------------------------------------------------------
  158. 3... WLALINK History
  159. ------------------------------------------------------------------------------
  160.  
  161.  
  162. v1.2 (23-Jan-2000) Added support for library files.
  163.  
  164. v1.1 (14-Jan-2000) Added support for Pocket Voice.
  165.                    Added "-v" -option for verbose information displaying.
  166.                    WLALINK now checks the object file formats.
  167.  
  168. v1.0 (12-Jan-2000) The first public release.
  169.  
  170.  
  171.  
  172. ------------------------------------------------------------------------------
  173. 4... Assembler Directives
  174. ------------------------------------------------------------------------------
  175.  
  176.  
  177. The directives are collected as they appear. Group 2 directives take place 
  178. as they are found. Group 1 directives are applied at the very end, after
  179. all the code has been processed, where they overwrite the actual code.
  180.  
  181. Here are the supported directives (with examples) in WLA:
  182.  
  183. Group 1:
  184.  
  185. .NAME = "NAME OF THE ROM"
  186. .ROMSIZE = 0
  187. .RAMSIZE = 0
  188. .EMPTYFILL = $C9
  189. .CARTRIDGETYPE = 1
  190. .LICENSEECODEOLD = $1A
  191. .LICENSEECODENEW = "1A"
  192. .COMPUTECHECKSUM
  193. .COMPUTECOMPLEMENTCHECK
  194.  
  195. Group 2:
  196.  
  197. .INCDIR "/usr/programming/gb/include/"
  198. .INCLUDE "cgb_hardware.i"
  199. .INCBIN "sorority.bin"
  200. .MACRO TEST
  201. .ENDM
  202. .BANK = 0
  203. .ORG = $150
  204. .DSB 256 $10
  205. .DSW 128 20
  206. .DB 100 $30 %1000 "HELLO WORLD!"
  207. .DW 16000 10 255
  208. .DEFINE IF $FF0F
  209. .IFDEF IF
  210. .IFNDEF IF
  211. .ELSE
  212. .ENDIF
  213. .REPT 6
  214. .ENDR
  215. .ENUM $C000
  216. .ENDE
  217. .SECTION "Init"
  218. .ENDS
  219.  
  220.  
  221. Descriptions:
  222.  
  223. -------------------------
  224. .NAME = "NAME OF THE ROM"
  225. -------------------------
  226.  
  227. Fills the 16 bytes ranging from $134 to $143 with the provided string.
  228. If the string is shorter than 16 bytes the remaining space is filled with $00.
  229.  
  230. This is not a compulsory directive.
  231.  
  232. ------------
  233. .ROMSIZE = 0
  234. ------------
  235.  
  236. Indicates the size of the ROM. This is a standard GB ROM size indicator value
  237. found at $148 in a GB ROM, and there this one is put to also.
  238.  
  239. This is a compulsory directive.
  240.  
  241. ------------
  242. .RAMSIZE = 0
  243. ------------
  244.  
  245. Indicates the size of the RAM. This is a standard GB RAM size indicator value
  246. found at $149 in a GB ROM, and there this one is put to also.
  247.  
  248. This is a compulsory directive.
  249.  
  250. ----------------
  251. .EMPTYFILL = $C9
  252. ----------------
  253.  
  254. This byte is used in filling the unused areas of the ROM file. EMPTYFILL
  255. defaults to $00.
  256.  
  257. This is not a compulsory directive.
  258.  
  259. ------------------
  260. .CARTRIDGETYPE = 1
  261. ------------------
  262.  
  263. Indicates the type of the cartridge (mapper and so on). This is a standard
  264. GB cartridge type indicator value found at $147 in a GB ROM, and there this
  265. one is put to also.
  266.  
  267. This is not a compulsory directive.
  268.  
  269. ----------------------
  270. .LICENSEECODEOLD = $1A
  271. ----------------------
  272.  
  273. This is a standard old licensee code found at $14B in a GB ROM, and there this
  274. one is put to also. .LICENSEECODEOLD cannot be defined with .LICENSEECODENEW.
  275.  
  276. This is not a compulsory directive.
  277.  
  278. -----------------------
  279. .LICENSEECODENEW = "1A"
  280. -----------------------
  281.  
  282. This is a standard new licensee code found at $144 and $145 in a GB ROM, and
  283. there this one is put to also. .LICENSEECODENEW cannot be defined with
  284. .LICENSEECODEOLD. $33 is inserted into $14B, as well.
  285.  
  286. This is not a compulsory directive.
  287.  
  288. ----------------
  289. .COMPUTECHECKSUM
  290. ----------------
  291.  
  292. When this directive is used WLA computes the ROM checksum found at $14E and
  293. $14F in a GB ROM.
  294.  
  295. This is not a compulsory directive.
  296.  
  297. -----------------------
  298. .COMPUTECOMPLEMENTCHECK
  299. -----------------------
  300.  
  301. When this directive is used WLA computes the ROM complement check found at
  302. $14D in a GB ROM.
  303.  
  304. This is not a compulsory directive, but very recommended. ;)
  305.  
  306. --------------------------------------
  307. .INCDIR "/usr/programming/gb/include/"    
  308. --------------------------------------
  309.  
  310. Changes the current include root directory. Use this to specify main
  311. directory for the following .INCLUDE and .INCBIN directives.
  312.  
  313. This is not a compulsory directive.
  314.  
  315. -------------------------
  316. .INCLUDE "cgb_hardware.i"
  317. -------------------------
  318.  
  319. Includes the specified file to the source file.
  320.  
  321. This is not a compulsory directive.
  322.  
  323. ----------------------
  324. .INCBIN "sorority.bin"
  325. ----------------------
  326.  
  327. Includes the specified data file into the source file. .INCBIN caches
  328. all files into memory, so you can .INCBIN any data file millions of
  329. times, but it is loaded only once.
  330.  
  331. This is not a compulsory directive.
  332.  
  333. -----------
  334. .MACRO TEST
  335. -----------
  336.  
  337. Begins a macro called 'TEST'. Macro text size is at max 1024 bytes.
  338.  
  339. You can use '@@@' inside a macro to eg. separate a label from the other
  340. macro 'TEST' occurrences. Take a look at the supplied source code
  341. 'features_test.s' for more information. You can use a macro with '@@@' at
  342. max 1000 times. '@@@' is converted to an integer ranging from 0 to 999 at
  343. compile time.
  344.  
  345. This is not a compulsory directive.
  346.  
  347. -----
  348. .ENDM
  349. -----
  350.  
  351. Ends the macro.
  352.  
  353. This is not a compulsory directive, but when .MACRO is used this one is
  354. required to terminate it.
  355.  
  356. ---------
  357. .BANK = 0
  358. ---------
  359.  
  360. Selects the ROM bank.
  361.  
  362. This is a compulsory directive.
  363.  
  364. -----------
  365. .ORG = $150
  366. -----------
  367.  
  368. Selects the starting address. The value supplied here is relative to the
  369. ROM bank given with .BANK.
  370.  
  371. This is a compulsory directive.
  372.  
  373. ------------
  374. .DSB 256 $10
  375. ------------
  376.  
  377. Defines 256 bytes of $10.
  378.  
  379. This is not a compulsory directive.
  380.  
  381. -----------
  382. .DSW 128 20
  383. -----------
  384.  
  385. Defines 128 words (two bytes) of 20.
  386.  
  387. This is not a compulsory directive.
  388.  
  389. --------------------------------
  390. .DB 100 $30 %1000 "HELLO WORLD!"
  391. --------------------------------
  392.  
  393. Defines bytes.
  394.  
  395. This is not a compulsory directive.
  396.  
  397. ----------------
  398. .DW 16000 10 255
  399. ----------------
  400.  
  401. Defines words (two bytes each). .DW takes only numbers and
  402. characters as input, not strings.
  403.  
  404. This is not a compulsory directive.
  405.  
  406. ----------------
  407. .DEFINE IF $FF0F
  408. ----------------
  409.  
  410. Assigns a number to a string. This is all it can do, nothing else.
  411. Defined strings can only be found amid the GB-Z80 code.
  412.  
  413. This is not a compulsory directive.
  414.  
  415. ---------
  416. .IFDEF IF
  417. ---------
  418.  
  419. If "IF" is defined, then the following piece of code is acknoledged
  420. until .ENDIF occurs in the text, unless it is skipped.
  421.  
  422. This is not a compulsory directive.
  423.  
  424. ----------
  425. .IFNDEF IF
  426. ----------
  427.  
  428. If "IF" is not defined, then the following piece of code is acknoledged
  429. until .ENDIF occurs in the text, unless it is skipped.
  430.  
  431. This is not a compulsory directive.
  432.  
  433. -----
  434. .ELSE
  435. -----
  436.  
  437. If the previous .IFDEF or .IFNDEF failed then the following text until
  438. .ENDIF is acknoledged.
  439.  
  440. This is not a compulsory directive.
  441.  
  442. ------
  443. .ENDIF
  444. ------
  445.  
  446. This terminates any .IFDEF or .IFNDEF directive.
  447.  
  448. This is not a compulsory directive, but if you use .IFDEF or .IFNDEF then
  449. you need also to apply this.
  450.  
  451. -------
  452. .REPT 6
  453. -------
  454.  
  455. Repeats the text enclosed between ".REPT x" and ".ENDR" x times (6 in
  456. this example). Repetition text size is at max 1024 bytes.
  457.  
  458. This is not a compulsory directive.
  459.  
  460. -----
  461. .ENDR
  462. -----
  463.  
  464. Ends the repetition.
  465.  
  466. This is not a compulsory directive, but when .REPT is used this one is
  467. required to terminate it.
  468.  
  469. -----------
  470. .ENUM $C000
  471. -----------
  472.  
  473. Starts enumeration from $C000. Very useful for defining variables.
  474. Here's an example:
  475.  
  476. ...
  477. .ENUM $A000
  478. _scroll_x DB
  479. _scroll_y DB
  480. player_x  DW
  481. player_y  DW
  482. map_01    DS 1024
  483. map_02    DS 2048
  484. .ENDE
  485. ...
  486.  
  487. Previous example transforms into following definitions:
  488.  
  489. .DEFINE _scroll_x $A000
  490. .DEFINE _scroll_y $A001
  491. .DEFINE player_x  $A002
  492. .DEFINE player_y  $A004
  493. .DEFINE map_01    $A006
  494. .DEFINE map_02    $A406
  495.  
  496. This is not a compulsory directive.
  497.  
  498. -----
  499. .ENDE
  500. -----
  501.  
  502. Ends the enumeration.
  503.  
  504. This is not a compulsory directive, but when .ENUM is used this one is
  505. required to terminate it.
  506.  
  507. ---------------
  508. .SECTION "Init"
  509. ---------------
  510.  
  511. Begins a section called "Init". Before a section can be declared, .BANK
  512. and .ORG must be used. .BANK tells the bank number where this section
  513. will be later relocated into. .ORG tells the offset for the relocation
  514. from the beginning of .BANK.
  515.  
  516. Here's an example:
  517.  
  518. ...
  519. .BANK 0
  520. .ORG $150
  521. .SECTION "Init"
  522.         DI
  523.         LD      SP, $FFFE
  524.         SUB     A
  525.         LD      ($FF00+R_IE), A
  526. .ENDS
  527. ...
  528.  
  529. This tells WLA that a section called "Init" must be located somewhere in
  530. bank 0, but not $0-$14F.
  531.  
  532. This is not a compulsory directive.
  533.  
  534. -----
  535. .ENDS
  536. -----
  537.  
  538. Ends the section.
  539.  
  540. This is not a compulsory directive, but when .SECTION is used this one is
  541. required to terminate it.
  542.  
  543.  
  544.  
  545. ------------------------------------------------------------------------------
  546. 5... Assembler Syntax
  547. ------------------------------------------------------------------------------
  548.  
  549.  
  550. 5.1. Case Sensitivity
  551.  
  552. WLA is case sensitive, so be careful. All the directives must be in
  553. uppercase.
  554.  
  555.  
  556. 5.2. Comments
  557.  
  558. Comments begin with ';' and end along with the line.
  559.  
  560.  
  561. 5.3. Labels
  562.  
  563. Labels are ordinary strings that end to ':'. Labels starting with "_"
  564. are considered as local labels and do not show outside sections where
  565. they were defined, or outside object files, if they were not defined
  566. inside a section.
  567.  
  568.  
  569. 5.4. Number Types
  570.  
  571. You can't use arithmetic or logic expressions, all values must be precomputed.
  572.  
  573. 1000 - decimal.
  574. $100 - hexadecimal.
  575. %100 - binary.
  576. 'x'  - character.
  577.  
  578.  
  579. 5.5. Strings
  580.  
  581. Strings begin and end to '"'. Note that no 0 is inserted to indicate the
  582. termination of the string like in eg. C. You'll have to do it yourself.
  583.  
  584.  
  585. 5.6. Supported GB-Z80 commands
  586.  
  587. Check out the file "z80.txt" coming in this archive.
  588.  
  589. Additionally there is a command called "DEBUG" which will translate to
  590. $ED. This one is not used in real GB-Z80, but my Game Boy emulator,
  591. Wzonka-Lad, will invert the power light mode when $ED is executed.
  592.  
  593. Don't use DEBUG if you are going to use your code elsewhere!
  594.  
  595.  
  596.  
  597. ------------------------------------------------------------------------------
  598. 6... Error Messages
  599. ------------------------------------------------------------------------------
  600.  
  601.  
  602. There are quite a few of them in WLA, but most of them are not as informative
  603. as I would like them to be. This will be fixed in the future. Mean while, be
  604. careful. ;)
  605.  
  606.  
  607.  
  608. ------------------------------------------------------------------------------
  609. 7... Supported Types
  610. ------------------------------------------------------------------------------
  611.  
  612.  
  613. 7.1. ROM Size
  614.  
  615.  $0 - 256Kbit =  32KByte =   2 banks
  616.  $1 - 512Kbit =  64KByte =   4 banks
  617.  $2 -   1Mbit = 128KByte =   8 banks
  618.  $3 -   2Mbit = 256KByte =  16 banks
  619.  $4 -   4Mbit = 512KByte =  32 banks
  620.  $5 -   8Mbit =   1MByte =  64 banks
  621.  $6 -  16Mbit =   2MByte = 128 banks
  622. $52 -   9Mbit = 1.1MByte =  72 banks
  623. $53 -  10Mbit = 1.2MByte =  80 banks
  624. $54 -  12Mbit = 1.5MByte =  96 banks
  625.  
  626.  
  627. 7.2. RAM Size
  628.  
  629.  $0 -    None
  630.  $1 -  16kbit =   2kByte =   1 bank
  631.  $2 -  64kbit =   8kByte =   1 bank
  632.  $3 - 256kbit =  32kByte =   4 banks
  633.  $4 -   1Mbit = 128kByte =  16 banks
  634.  
  635.  
  636. 7.3. Cartridge Type
  637.  
  638. It's up to the user to check that the cartridge type is valid and
  639. can be used combined with the supplied ROM and RAM sizes.
  640.  
  641. Here's a list of what the value can be:
  642.  
  643.  $0 - ROM ONLY
  644.  $1 - ROM+MBC1
  645.  $2 - ROM+MBC1+RAM
  646.  $3 - ROM+MBC1+RAM+BATT
  647.  $5 - ROM+MBC
  648.  $6 - ROM+MBC2+BATTERY
  649.  $8 - ROM+RAM
  650.  $9 - ROM+RAM+BATTERY
  651.  $B - ROM+MMM01
  652.  $C - ROM+MMM01+SRAM
  653.  $D - ROM+MMM01+SRAM+BATT
  654.  $F - ROM+MBC3+TIMER+BATT
  655. $10 - ROM+MBC3+TIMER+RAM+BATT
  656. $11 - ROM+MBC3
  657. $12 - ROM+MBC3+RAM
  658. $13 - ROM+MBC3+RAM+BATT
  659. $19 - ROM+MBC5
  660. $1A - ROM+MBC5+RAM
  661. $1B - ROM+MBC5+RAM+BATT
  662. $1C - ROM+MBC5+RUMBLE
  663. $1D - ROM+MBC5+RUMBLE+SRAM
  664. $1E - ROM+MBC5+RUMBLE+SRAM+BATT
  665. $1F - Pocket Camera
  666. $BE - Pocket Voice
  667. $FD - Bandai TAMA5
  668. $FE - Hudson HuC-3
  669. $FF - Hudson HuC-1
  670.  
  671.  
  672.  
  673. ------------------------------------------------------------------------------
  674. 8... Bugs
  675. ------------------------------------------------------------------------------
  676.  
  677.  
  678. If you find bugs, please let me know asap. Anything, small or big, send
  679. me mail!
  680.  
  681.  
  682.  
  683. ------------------------------------------------------------------------------
  684. 9... Files
  685. ------------------------------------------------------------------------------
  686.  
  687.  
  688. 9.1. 'features_test.s'
  689.  
  690. 'features_test.s' shows how to use most of the WLA's directives and a
  691. little of the GB-Z80 syntax itself.
  692.  
  693. The program it describes is supposed to change the background color, so it
  694. doesn't do really anything fantastic. ;)
  695.  
  696.  
  697. 9.2. 'gb_hardware.i'
  698.  
  699. 'gb_hardware.i' has all the Game Boy hardware register names. Names are
  700. the same as found in numerous Game Boy hardware documentations.
  701.  
  702.  
  703. 9.3. 'cgb_hardware.i'
  704.  
  705. 'cgb_hardware.i' has all the Color Game Boy hardware register names. Names
  706. are the same as found in numerous Color Game Boy hardware documentations.
  707.  
  708.  
  709. 9.4. 'nintendo_logo.i'
  710.  
  711. Include this file to your projects if you want to run the code on a real
  712. Game Boy. Required data for Nintendo Character Area.
  713.  
  714.  
  715. 9.5. 'pocket_voice.i'
  716.  
  717. Pocket Voice register and command definitions. Based on Bung's Pocket Voice
  718. information.
  719.  
  720.  
  721.  
  722. ------------------------------------------------------------------------------
  723. 10.. Temporary Files
  724. ------------------------------------------------------------------------------
  725.  
  726.  
  727. Note that WLA will generate two temporary files while it works. Make sure
  728. the directories where the temporary files are generated to exist.
  729.  
  730. On Amiga machines these files are placed in T: and are called
  731. "gba_a.tmp" and "gba_b.tmp".
  732.  
  733. On Linux x86 systems these files are placed in /tmp/ and are called
  734. ".gba_a.tmp" and ".gba_b.tmp".
  735.  
  736. On MSDOS x86 machines these files are placed in C:\TEMP\ and are
  737. called "GBA_A.TMP" and "GBA_B.TMP".
  738.  
  739. So remember not to use more than one WLA process at a time. I will
  740. be honoured to fix this, but it requires a request from a WLA Power
  741. User. ;)
  742.  
  743. When WLA finishes its work these two files are deleted as they serve
  744. of no further use.
  745.  
  746.  
  747.  
  748. ------------------------------------------------------------------------------
  749. 11.. Compiling
  750. ------------------------------------------------------------------------------
  751.  
  752.  
  753. 11.1. Compiling ROM images
  754.  
  755. To compile a ROM image from an asm file use the following:
  756.  
  757. "wla [-v] <ASM FILE> <OUTPUT FILE>"
  758.  
  759. One asm file, one ROM image. Simple, but not very flexible. Compile object
  760. files and link them together in the case of a bigger project.
  761.  
  762. If "-v" is used, WLA displays information about ROM file after a
  763. succesful compile.
  764.  
  765.  
  766. 11.2. Compiling Object Files
  767.  
  768. Version 2.0 of WLA introduced object files. To compile an object file use:
  769.  
  770. "wla [-v] <ASM FILE> -o <OUTPUT FILE>"
  771.  
  772. These object files can be linked together (or with library files) later
  773. with "wlalink".
  774.  
  775. Name object files so that they can be recognized as object files. Normal
  776. suffices are ".o" and ".obj".
  777.  
  778. With object files you can reduce the amount of compiling when editing
  779. small parts of the program. Note also the possibility of using local
  780. labels (starting with "_").
  781.  
  782. Note! When you compile objects, group 1 directives are saved for linking
  783. time, when they are all compared and if they differ, an error message is
  784. shown. It is advisable to use something like an include file to hold all
  785. the group 1 directives for that particular project and include it to every
  786. object file.
  787.  
  788. If you are interested in the WLA object file format, take a look at the
  789. file "object_format.txt" which is included in the release archive.
  790.  
  791. If "-v" is used, WLA displays information about the object file after a
  792. succesful compile.
  793.  
  794.  
  795. 11.3. Compiling Library Files
  796.  
  797. Version 2.3 of WLA introduced library files. To compile a library file use:
  798.  
  799. "wla [-v] <ASM FILE> -l <OUTPUT FILE>"
  800.  
  801. Name object files so that they can be recognized as library files. Normal
  802. suffice is ".lib".
  803.  
  804. With library files you can reduce the amount of compiling. Library files
  805. are meant to hold general functions that can be used in different projects.
  806. Note also the possibility of using local labels (starting with "_").
  807.  
  808. If you are interested in the WLA library file format, take a look at the
  809. file "wla_file_formats.txt" which is included in the release archive.
  810.  
  811. If "-v" is used, WLA displays information about the library file after a
  812. succesful compile.
  813.  
  814.  
  815.  
  816. ------------------------------------------------------------------------------
  817. 12.. Linking
  818. ------------------------------------------------------------------------------
  819.  
  820.  
  821. After you have produced one or more object files and perhaps some library
  822. files, you might want to link them together to produce a ROM image. "wlalink"
  823. is the program you use for that. Here's how you use it:
  824.  
  825. "wlalink [-v] <OBJ1/LIB1> <OBJ2/LIB2> <OBJ3/LIB3> ... -o <OUTPUT FILE>"
  826.  
  827. Make sure all object files have same resolution (same ROM name, same ROM
  828. size...), otherwise WLALINK will fail. And make sure you don't try to insert
  829. libraries into banks that don't exist.
  830.  
  831. If "-v" is used, WLALINK displays information about ROM file after a
  832. succesful linking.
  833.  
  834.  
  835.  
  836. ------------------------------------------------------------------------------
  837. 13.. Pocket Voice
  838. ------------------------------------------------------------------------------
  839.  
  840.  
  841. Pocket Voice uses its own MBC. You can enable Pocket Voice mode by selecting
  842. Pocket Voice cartridge type ($BE). In PV mode bank 0 is 24KB and the rest
  843. are 8KB. Note that WLA assumes that ROM offset is all the time 0.
  844. If you use something else as the offset, make sure to compute the jumps by
  845. hand as WLA cannot do that.
  846.  
  847.  
  848.  
  849. ------------------------------------------------------------------------------
  850. 14.. Author
  851. ------------------------------------------------------------------------------
  852.  
  853.  
  854. Ville Helin, the author of Wzonka-Lad, a Game Boy emulator for the Amiga
  855. machines. I have 22 years behind me, many more to travel through. I study
  856. information technology at the Helsinki University of Technology
  857. (http://www.hut.fi). I like Game Boy (goes without saying), anime soap operas,
  858. Japanese culture and Kung-Fu.
  859.  
  860. email: vhelin@cc.hut.fi
  861. hpage: http://www.hut.fi/~vhelin
  862.  
  863.  
  864.  
  865. ------------------------------------------------------------------------------
  866. 15.. Thanks
  867. ------------------------------------------------------------------------------
  868.  
  869.  
  870. Thanks to Madonna MkII (Matra Computer Corp.) and Gaelan Griffin
  871. for reporting bugs in WLA. I wouldn't mind if more people used WLA. ;)
  872.  
  873. Thanks to Mark Knox for helping me with the MSDOS port!
  874.  
  875.  
  876.  
  877. ------------------------------------------------------------------------------
  878. 16.. Future
  879. ------------------------------------------------------------------------------
  880.  
  881.  
  882. Future enhancements (if I get really inspired):
  883.  
  884. - Proper error messages with line numbers.
  885. - Other optimizations, bug fixes and enhancements.
  886.  
  887.  
  888.  
  889. ------------------------------------------------------------------------------
  890. 17.. Support
  891. ------------------------------------------------------------------------------
  892.  
  893.  
  894. The currently supported systems are MSDOS/x86, AmigaOS/680x0 and Linux/x86.
  895. If you'd like to see WLA for other platforms/configurations, send me mail
  896. and we'll see what I can do.
  897.  
  898.  
  899.  
  900. ------------------------------------------------------------------------------
  901. 18.. Legal Note
  902. ------------------------------------------------------------------------------
  903.  
  904.  
  905. WLA GB-Z80 Macro Assembler Copyright 1998-2000 Ville Helin
  906.  
  907. I take no responsibility what WLA does on your machine. Remember
  908. that when using WLA you do it at your own risk.
  909.  
  910. WLA is freeware as long as it is used to produce non-commercial software.
  911.  
  912. WLA cannot be used in any commercial project without my permission.
  913.  
  914. If and when WLA is used in a commercial project, I want something as
  915. well, like the finished product. ;) Or credits would be nice. ;)
  916. Something, so I know there are people using WLA.
  917.  
  918. WLA may not be put on any CD DISC or HD DISK or any other form of media
  919. unless I myself grant the premission.
  920.  
  921. If I am not contacted before WLA is used in a process that involves money,
  922. then may the seven drunken Gods strike such a foul business down! If the
  923. Gods won't do me a favor, I'll ask Monkey King and come and do my Kung-Fu.
  924.  
  925. Game Boy and Game Boy Color are copyrighted by Nintendo.
  926.